import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Login from '../components/login/Login'
import Home from '../components/views/sys/sys-user/SysUser'
import SysRole from '../components/views/sys/sys-role/SysRole'
import LoginLog from '../components/views/sys/sys_log/SysLoginLog'
import SysMenu from '../components/views/sys/sys-menu/SysMenu'

import SysDept from '../components/views/sys/sys_dept/SysDept'



import ToolCode from '../components/views/tool/tool-code/ToolCode.vue'


import JoyHeadlines from '../components/views/joy/headlines/JoyHeadlines'
import WeChatSelection from '../components/views/joy/headlines/WeChatSelection'

import GoodsCategory from '../components/views/goods/goods-category/GoodsCategory'
import GoodsProduct from '../components/views/goods/goods-product/GoodsProduct'
import TraderCustomer from '../components/views/trader/trader-customer/TraderCustomer'
import TraderSupplier from '../components/views/trader/trader-supplier/TraderSupplier'



import PurchaseOrder from '../components/views/purchase/purchase-order/PurchaseOrder'
import PurchaseCart from '../components/views/purchase/purchase-cart/PurchaseCart'
import PurchaseHistory from '../components/views/purchase/purchase-history/PurchaseHistory'


import SalesOrder from '../components/views/sales/sales-order/SalesOrder'
import SalesHistory from '../components/views/sales/sales-history/SalesHistory'


import HomePage from '../components/home/HomePage'

Vue.use(Router)

export default new Router({
  routes: [
    {path: '/login', name: 'Login', component: Login},

    {path: '/sys', name: 'home', component: HelloWorld,
      children: [
        {path: 'home_page',name: 'home_page',  component: HomePage},
        {path: 'user',name: 'user',  component: Home},
        {path: 'login_log',name: 'login_log',  component: LoginLog},
        {path: 'role',name: 'role', component: SysRole},
        {path: 'menu',name: 'menu',  component: SysMenu},
        {path: 'dept',name: 'dept',  component: SysDept},
      ]
    },
    {path: '/dict', name: 'home', component: HelloWorld,
      children: [
        {path: 'data',name: 'data', component: Home},
      ]
    },

    {path: '/joy', name: 'home', component: HelloWorld,
      children: [
        {path: 'headlines',name: 'headlines', component: JoyHeadlines},
        {path: 'wx_selection',name: 'wx_selection', component: WeChatSelection},
      ]
    },

    {path: '/tool', name: 'home', component: HelloWorld,
      children: [
        {path: 'code',name: 'code', component: ToolCode},

      ]
    },
    {path: '/goods', name: 'home', component: HelloWorld,
      children: [
        {path: 'category',name: 'category', component: GoodsCategory},
        {path: 'product',name: 'product', component: GoodsProduct},
      ]
    },

    {path: '/trader', name: 'home', component: HelloWorld,
      children: [
        {path: 'customer',name: 'customer', component: TraderCustomer},
        {path: 'supplier',name: 'supplier', component: TraderSupplier},
      ]
    },



    {path: '/purchase', name: 'home', component: HelloWorld,
      children: [
        {path: 'order',name: 'order', component: PurchaseOrder},
        {path: 'cart',name: 'cart', component: PurchaseCart},
        {path: 'history',name: 'history', component: PurchaseHistory},
      ]
    },


    {path: '/sales', name: 'home', component: HelloWorld,
      children: [
        {path: 'order',name: 'order', component: SalesOrder},
        {path: 'history',name: 'history', component: SalesHistory},
      ]
    },


    {path: '*', redirect:'/sys/home_page'},
  ]
})
